class Person {
  constructor(name) {
    this.name = name;
  }

  static of(name) {
    return new Person(name);
  }

  sayName() {
    console.log(`Hi！My name is ${ this.name }`);
  }
}

// Person.of('薛帅康').sayName();

class Student extends Person {
  constructor(name, studyNumber) {
    super(name);
    this.studyNumber = studyNumber;
  }

  static of(name, studyNumber) {
    return new Student(name, studyNumber);
  }

  sayStudyNumber() {
    super.sayName();
    console.log(`Hi！My studyNumber is ${ this.studyNumber }，I'm ${ this.name }`);
  }
}

Student.of('薛帅康', 12).sayStudyNumber();
